﻿<UserControl
    x:Class="HDK.Demo.Pages.Views.DataVirtualizationTest"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:HDK.Demo.Pages.Views"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400">
    
    <UserControl.Resources>
        <CollectionViewSource x:Key="dataSource" Source="{Binding CustomerList}" />
    </UserControl.Resources>
    
    <Grid>
        <ListView ItemsSource="{Binding Source={StaticResource dataSource}}">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <Grid Width="120" HorizontalAlignment="Center">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <TextBlock Text="Id:  " FontWeight="Bold" HorizontalAlignment="Right"/>
                        <TextBlock Text="{Binding Data.Id}" Grid.Column="1" />
                        <TextBlock Text="Name:  " FontWeight="Bold" Grid.Row="1"/>
                        <TextBlock Text="{Binding Data.Name}" Grid.Row="1" Grid.Column="1"/>
                    </Grid>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
    </Grid>
</UserControl>
